function Delegate() {
    this.funcArr = [];
}
Delegate.prototype.Add = function (callback, context) {
    if (!typeof callback == "function") return;
    this.funcArr.add({ "cb": callback, "ctx": context });
};
Delegate.prototype.Call = function (arg) {
    for (var i = 0; i < this.funcArr.length; i++) {
        this.funcArr[i]["cb"].call(this.funcArr[i]["ctx"], arg);
    }
};
Delegate.prototype.Apply = function (args) {
    for (var i = 0; i < this.funcArr.length; i++) {
        this.funcArr[i]["cb"].apply(this.funcArr[i]["ctx"], args);
    }
};